﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using SimpleData.Infrastructure.Plugins;
using SimpleData.Infrastructure.Validation;
using System.Linq.Expressions;

namespace SimpleData.Data
{

	/// <summary>
	/// Representa um acesso ao banco de dados
	/// </summary>
	public interface IRepository : IPluggable, IDisposable
	{

		TEntity Create<TEntity>()
			where TEntity : class;

		void Add<TEntity>( TEntity entity )
			where TEntity : class;

		IQueryable<TEntity> FindAll<TEntity>( Expression<Func<TEntity, bool>> where )
			where TEntity : class;

		IEnumerable<EntityValidationResult> SaveChanges();
	}
}
